package com.wsy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wsy.entity.Bookinfo;
import com.wsy.mapper.BookInfoMapper;
import com.wsy.service.BookInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BookInfoServiceImpl extends ServiceImpl<BookInfoMapper, Bookinfo> implements BookInfoService {
    @Resource
    BookInfoMapper bookInfoMapper;

    @Override
    public PageInfo<Bookinfo> select(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<Bookinfo>(bookInfoMapper.select());
    }

    @Override
    public int addBook(Bookinfo bookinfo) {
        return bookInfoMapper.addBook(bookinfo);
    }

    @Override
    public int updBook(Bookinfo bookinfo) {
        return bookInfoMapper.updBook(bookinfo);
    }
}
